package org.springblade.modules.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.springblade.modules.admin.dto.TaskPlanPageQueryDTO;
import org.springblade.modules.admin.entity.MaintainTemplate;import org.springblade.modules.admin.vo.MaintainTemplateVO;
import org.springblade.modules.admin.vo.TemplateDetailVO;
import org.springblade.modules.admin.vo.TemplateSelectDownVO;
import org.springblade.modules.admin.vo.TemplateVO;

import java.util.List;

public interface MaintainTemplateMapper extends BaseMapper<MaintainTemplate> {
    /**
     * 自定义分页
     *
     * @param page
     * @param maintainTemplate
     * @return
     */
    List<MaintainTemplateVO> selectMaintainTemplatePage(IPage page, MaintainTemplateVO maintainTemplate);

    List<TemplateSelectDownVO> getTemplateSelectDown(@Param("applyElevatorType") String applyElevatorType, @Param("tenantIds") List<String> tenantIds, @Param("keyword") String keyword,@Param("taskPlanIds") List<Long> taskPlanIds,@Param("sceneTypeIds") List<Long> sceneTypeIds);

	List<TemplateVO> selectTemplatePage(@Param("pageQuery") TaskPlanPageQueryDTO pageQuery,@Param("tenantIds") List<String> tenantIds, IPage<TemplateVO> page);

    TemplateDetailVO selectTemplateDetail(@Param("id") Long id);

	Integer selectElevatorCountByTemplate(@Param("templateId") Long templateId);

	Integer selectElevatorCountByTemplateContent(@Param("contentIds") List<Long> contentIds);

	List<TemplateSelectDownVO> selectTemplateHistorySelectDown(@Param("tenantIds") List<String> tenantIds,@Param("keyword") String keyword);

	List<TemplateSelectDownVO> selectTemplateDownByName(@Param("planType") String planType, @Param("tenantIds") List<String> tenantIds, @Param("keyword") String keyword,@Param("taskPlanIds") List<Long> taskPlanIds);

	List<TemplateSelectDownVO> selectByPlan(@Param("tenantIds") List<String> tenantIds, @Param("planId") Long planId);

	Integer selectPlanCountByTemplate(@Param("templateId") Long templateId);

}
